#ifndef USERADD_H
#define USERADD_H

#include <QWidget>
#include <QPaintEvent>
#include <QPainter>
#include <QListView>
#include "ettadatastruct.h"

namespace Ui {
class UserAdd;
}

class SqlHelper;
class BllDataFlow;

class UserAdd : public QWidget
{
    Q_OBJECT

public:
    explicit UserAdd(QWidget *parent = nullptr);
    ~UserAdd();
    void clearInput();

private slots:
    void on_btnConfirmAddUser_clicked();
    void on_btnCancelAddUser_clicked();
    void on_btnIsOn_toggled(bool checked);
    void on_btnMenu_Close_clicked();
    void on_btnClose_clicked();

    void on_lineUsername_returnPressed();

    void showAllRolesSlot();
    void retranslateUiSlot();

private:
    void initWidget();
    bool checkUserName();
    bool checkPassWord();
    bool checkRoleName();

protected:
    void paintEvent(QPaintEvent *event);

private:
    Ui::UserAdd *ui;
    BllDataFlow * bdf;
    SqlHelper * sqlHelper;
    User user;
    QString confirmPW;
    QRect location;
};

#endif // USERADD_H
